FROM hub-mirror.wps.cn/dockerhub/library/golang:1.19.2-alpine
WORKDIR /app
ENV go env -w GOSUMDB=off
ENV go env -w GOPROXY=https://mirrors.wps.cn/go/
ENV GO111MODULE=on \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories

COPY . .

RUN go get
RUN go build -v -o queuegateway main.go

EXPOSE 8080

#FROM hub-mirror.wps.cn/dockerhub/library/golang:1.19-alpine
#WORKDIR /app
#
#COPY --from=gobuilder /app/. .
#COPY --from=gobuilder /app/queuegateway .
#COPY --from=gobuilder /app/config config
#
#EXPOSE 8080
#
#CMD ["sh", "/app/queuegateway"]
